package decoratorpattern;

public class DecoratorPatternDemo {

	public static void main(String[] args) {
		XiaoMiMobile xiaoMiMobile = new XiaoMiMobile();
		System.out.println("被装饰之前：");
		xiaoMiMobile.mobileName();
		
		System.out.println("被装饰之后：");
		//利用装饰者模式 给对象动态赋予属性
		Mobile xiaomi = new MobileTaxDecorator(xiaoMiMobile,"300");
		xiaomi.mobileName();
		
		System.out.println("被装饰之前：");
		HuaweiMobile huaweiMobile = new HuaweiMobile();
		huaweiMobile.mobileName();
		
		System.out.println("被装饰之后：");
		//利用装饰者模式 给对象动态赋予属性
		Mobile huawei = new MobileTaxDecorator(huaweiMobile, "400");
		huawei.mobileName();
	}

}
